package cn.iocoder.yudao.module.product.controller.admin.spu.vo;

import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.module.product.enums.spu.DeliveryMethodEnum;
import cn.iocoder.yudao.module.product.enums.spu.ProductSkuStatusEnum;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "管理后台 - 商品 SKU Response VO")
@Data
public class ProductSkuRespVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private Long id;

    @Schema(description = "销售价格，单位：分", requiredMode = Schema.RequiredMode.REQUIRED, example = "1999")
    private Integer price;

    @Schema(description = "市场价", example = "2999")
    private Integer marketPrice;

    @Schema(description = "成本价", example = "19")
    private Integer costPrice;

    @Schema(description = "条形码", example = "15156165456")
    private String barCode;

    @Schema(description = "图片地址", example = "https://www.iocoder.cn/xx.png")
    private String picUrl;

    @Schema(description = "库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
    private Integer stock;

    @Schema(description = "商品重量,单位：kg 千克", example = "1.2")
    private Double weight;

    @Schema(description = "商品体积,单位：m^3 平米", example = "2.5")
    private Double volume;

    @Schema(description = "一级分销的佣金，单位：分", example = "199")
    private Integer firstBrokeragePrice;

    @Schema(description = "二级分销的佣金，单位：分", example = "19")
    private Integer secondBrokeragePrice;

    @Schema(description = "属性数组")
    private List<ProductSkuSaveReqVO.Property> properties;

    // ========== 新增SKU 相关字段 =========

    @Schema(description = "商品SKU名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "清凉小短袖")
    @NotEmpty(message = "商品SKU名字不能为空")
    private String name;

    @Schema(description = "商品SKU简介描述", example = "清凉小短袖")
    private String introduction;

    @Schema(description = "排序字段", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "排序字段不能为空")
    private Integer sort;

    @Schema(description = "sku状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "sku状态不能为空")
    @InEnum(ProductSkuStatusEnum.class)
    private Integer status;

    @Schema(description = "最低起购件数", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "最低起购件数不能为空")
    private Integer minPurchaseQuantity;

    @Schema(description = "最高起购件数", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "最高起购件数不能为空")
    private Integer maxPurchaseQuantity;

    @InEnum(DeliveryMethodEnum.class)
    @Schema(description = "发货方式")
    private Integer deliveryMethod;

    @Schema(description = "面值描述")
    private String denomination;

    @Schema(description = "固定面值，单位：分")
    private Integer denominationFixed;

    @Schema(description = "是否自定义面值")
    private Boolean customDenomination;

    @Schema(description = "最小自定义面值，单位：分")
    private Integer minCustomDenomination;

    @Schema(description = "最大自定义面值，单位：分")
    private Integer maxCustomDenomination;

    @Schema(description = "卡密商品编号")
    private String cardKeyProductNo;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2023-05-24 00:00:00")
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    @Schema(description = "折扣率")
    private BigDecimal discountRate;

    // ========== 新增eSim SKU 相关字段 =========

    @Schema(description = "eSim流量大小")
    private Integer esDataAllowanceMb;

    @Schema(description = "eSim有效期")
    private Integer esValidityPeriodDays;

    @Schema(description = "eSim商品id")
    private String esProductId;


}
